package com.atguigu.srb.core.controller.admin;


import com.atguigu.common.result.R;
import com.atguigu.srb.core.pojo.vo.BorrowerAttachVO;
import com.atguigu.srb.core.service.BorrowerAttachService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 借款人上传资源表 前端控制器
 * </p>
 *
 * @author 杜佳佳
 * @since 2021-04-13
 */
@Api(tags = "借款人附件管理")
@RestController
@RequestMapping("/admin/core/borrowerAttach")
public class AdminBorrowerAttachController {

    @Autowired
    private BorrowerAttachService borrowerAttachService;

    @ApiOperation("根据借款人id查询")
    @GetMapping("/list/{borrowerId}")
    public R list(@PathVariable Long borrowerId){
        List<BorrowerAttachVO> borrowerAttachVOS = borrowerAttachService.selectBorrowAttachVOList(borrowerId);
        return R.ok().data("list",borrowerAttachVOS);
    }

}

